And add basic docs for our manually implemented functions.
})
}
+/// Error returned from parsing a checksum.
#[derive(Debug, thiserror::Error)]
pub enum ChecksumError {
+ /// Invalid hex checksum string.
#[error("invalid hex checksum string")]
InvalidHexString,
+ /// Invalid base64 checksum string
#[error("invalid base64 checksum string")]
InvalidBase64String,
}
use glib_sys::GFALSE;
use std::{future::Future, mem::MaybeUninit, pin::Pin, ptr};
+/// Compute the SHA-256 checksum of a file.
pub fn checksum_file<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(
f: &P,
objtype: ObjectType,
}
}
+/// Asynchronously compute the SHA-256 checksum of a file.
pub fn checksum_file_async<
P: IsA<gio::File>,
Q: IsA<gio::Cancellable>,
}
}
+/// Asynchronously compute the SHA-256 checksum of a file.
#[allow(clippy::type_complexity)]
pub fn checksum_file_async_future<P: IsA<gio::File> + Clone + 'static>(
f: &P,
}))
}
+/// Compute the OSTree checksum of a content object.
pub fn checksum_file_from_input<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(
file_info: &gio::FileInfo,
xattrs: Option<&glib::Variant>,
//! along with a layer for deploying them and managing the bootloader configuration.
#![cfg_attr(feature = "dox", feature(doc_cfg))]
+#![deny(unused_must_use)]
+#![warn(missing_docs)]
+#![warn(rustdoc::broken_intra_doc_links)]
// Re-export our dependencies. See https://gtk-rs.org/blog/2021/06/22/new-release.html
// "Dependencies are re-exported". Users will need e.g. `gio::File`, so this avoids
#[rustfmt::skip]
#[allow(clippy::all)]
#[allow(unused_imports)]
+#[allow(missing_docs)]
mod auto;
pub use crate::auto::functions::*;
pub use crate::auto::*;
#[cfg(test)]
mod tests;
-// prelude
+/// Prelude, intended for glob imports.
pub mod prelude {
pub use crate::auto::traits::*;
// See "Re-export dependencies above".
Repo::new(&gio::File::for_path(path.as_ref()))
}
+ /// Find all objects reachable from a commit.
pub fn traverse_commit<P: IsA<gio::Cancellable>>(
&self,
commit_checksum: &str,
}
}
+ /// List all branch names (refs).
pub fn list_refs<P: IsA<gio::Cancellable>>(
&self,
refspec_prefix: Option<&str>,
}
}
+ /// Write a content object from provided input.
pub fn write_content<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(
&self,
expected_checksum: Option<&str>,
}
}
+ /// Write a metadata object.
pub fn write_metadata<P: IsA<gio::Cancellable>>(
&self,
objtype: ObjectType,
}
}
+ /// Asynchronously write a content object.
pub fn write_content_async<
P: IsA<gio::InputStream>,
Q: IsA<gio::Cancellable>,
}
}
+ /// Asynchronously write a content object.
pub fn write_content_async_future<P: IsA<gio::InputStream> + Clone + 'static>(
&self,
expected_checksum: Option<&str>,
}))
}
+ /// Asynchronously write a metadata object.
pub fn write_metadata_async<
P: IsA<gio::Cancellable>,
Q: FnOnce(Result<Checksum, Error>) + Send + 'static,
}
}
+ /// Asynchronously write a metadata object.
pub fn write_metadata_async_future(
&self,
objtype: ObjectType,
use std::ptr;
impl SePolicy {
+ /// Reset the SELinux filesystem creation context.
pub fn fscreatecon_cleanup() {
unsafe {
ffi::ostree_sepolicy_fscreatecon_cleanup(ptr::null_mut());